/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.diamondcalculation
 * IDiamondCalculationService.java
 * 创建人:小胡 
 * 时间：2017年03月03日 13:12:41
 *
 */
package com.tz.service.diamondcalculation.impl;

import com.tz.bean.DiamondCalculation;
import com.tz.bean.TzParams;
import com.tz.dao.diamondcalculation.IDiamondCalculationMapper;
import com.tz.service.diamondcalculation.IDiamondCalculationService;
import com.tz.util.TmStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 钻石估价管理serviceImpl
 * IDiamondCalculationService
 * 创建人:小胡 
 * 时间：2017年03月03日 13:12:41
 * @version 1.0.0
 * 
 */
@Service
public class DiamondCalculationServiceImpl implements IDiamondCalculationService{

	@Autowired
	private IDiamondCalculationMapper diamondcalculationMapper;
	
	@Override
	public List<HashMap<String, Object>> findDiamondCalculations(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("create_time desc");
		return diamondcalculationMapper.findDiamondCalculations(params);
	}
	
	@Override
	public int count(TzParams params) {
		return diamondcalculationMapper.count(params);
	}

	@Override
	public HashMap<String ,Object> getDiamondCalculation(Integer id) {
		return diamondcalculationMapper.getDiamondCalculation(id);
	}

	@Override
	public int save(DiamondCalculation diamondcalculation) {
		return diamondcalculationMapper.save(diamondcalculation);
	}

	@Override
	public int update(DiamondCalculation diamondcalculation) {
		return diamondcalculationMapper.update(diamondcalculation);
	}

	@Override
	public int delete(TzParams params) {
		return diamondcalculationMapper.delete(params);
	}

	@Override
	public List<HashMap<String, Object>> getAllWeightlevel() {
		return diamondcalculationMapper.getAllWeightlevel();
	}

	public HashMap<String, Object> getCountRecord(DiamondCalculation diamondCalculationl){
		return diamondcalculationMapper.getCountRecord(diamondCalculationl);
	}

}
